/**
 * @file   MiraJoint2D.h
 * @author Josep Sabater (jsabaterm@el.ub.edu)
 * @date   November, 2016
 * @version 1.0.0
 * @ingroup QMira
 * @brief  Joint 2D class
 *
 */
#ifndef MIRA_JOINT_2D_H
#define MIRA_JOINT_2D_H

#include <iostream>
#include <MiraPlacement2D.h>

namespace QMira {
    
    class Joint2D {
    public:
        
        typedef std::vector<Joint2D> Joint2DCont_t;
                
        // ! A Matrix of Joint2D
        typedef std::vector<Joint2DCont_t> Joint2DMatrix_t;
        
        Joint2D(const std::string name,
                const MiraGeometryLib::Placement2D &location=MiraGeometryLib::Placement2D(0,0,0)) 
                    : name_(name)
                    , location_(location) {};
        Joint2D(const std::string name,
                const double x, 
                const double y, 
                const double orient) 
                    : name_(name)
                    , location_( MiraGeometryLib::Placement2D(x, y, orient)) {};
                    
        inline const std::string& name() const { return name_; }
        inline const MiraGeometryLib::Placement2D& location() const { return location_; }
        inline double x() const {return location_.pos.x(); }
        inline double y() const {return location_.pos.y(); }
        inline double orient() const {return location_.orient; }
                    
        friend std::ostream& operator << (std::ostream& os, const Joint2D& j);                    
        
    private:
        const std::string name_;
        MiraGeometryLib::Placement2D location_;
    };
}

#endif /*MIRA_JOINT_2D_H*/